import request from '@/utils/request'

export default{
    getChapterVideoByCourseId(courseId){
        return request({ 
            url:`/eduservice/chapter/tree/${courseId}`,
            method:'get'
        });
    },
    getChapterById(chapterId){
        return request({ 
            url:`/eduservice/chapter/${chapterId}`,
            method:'get'
        });
    },
    addChapter(chapter){
        return request({ 
            url:`/eduservice/chapter`,
            method:'post',
            data:chapter
        });
    },
    updateChapter(chapter){
        return request({ 
            url:`/eduservice/chapter`,
            method:'put',
            data:chapter
        });
    },
    deleteChapter(chapterId){
        return request({ 
            url:`/eduservice/chapter/${chapterId}`,
            method:'delete'
        });
    },
}